import java.io.ObjectOutputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.beans.XMLEncoder;
import java.util.Vector;

public class SerializationExampleWrite
{
 public static void main(String [] args)
 {
 String filename = "ser.xml";
 if(args.length > 0)
     {
       filename = args[0];
     }

     PersistentProjectConfig persistentProjectConfig = new PersistentProjectConfig("atih2010", "s_e");
     PersistentTestBedConfig persistentTestBedConfig = new PersistentTestBedConfig();

     Vector<PersistentRecord> pr = new Vector<PersistentRecord>();
     pr.add(new PersistentRecord("vm_XP",  "1", "dep_prep", "TrueImage/2010/987654321/tih_s_e.exe"));
     pr.add(new PersistentRecord("vm_XP",  "2", "dep_prep", " Z:\\\\unzip.exe -o \\\\\\\\10.250.34.36\\\\builds\\\\TrueImage\\\\2010\\\\987654321\\\\tih_s_e.exe -d " +
             "I:\\\\engine\\\\bin\\\\"));
     pr.add(new PersistentRecord("vm_XP",  "1", "dep_extract", " del /F I:\\\\Engine\\\\ATI2010.csv"));
     PersistentScenarioConfig persistentScenarioConfig = new PersistentScenarioConfig(pr);
     PersistentScenarioMap persistentScenarioMap = new PersistentScenarioMap(persistentProjectConfig, persistentTestBedConfig, persistentScenarioConfig);
     FileOutputStream fos = null;
     XMLEncoder out = null; 
     try
     {
       fos = new FileOutputStream(filename);
       out = new XMLEncoder(fos);
       out.writeObject(persistentScenarioMap);
       out.close();
     }
     catch(IOException ex)
     {
       ex.printStackTrace();
     }
   }
}

